home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 September / macformat-041.iso / mac / Shareware City / Graphics / MacSPD / Sources / lib.h < prev    next >
Encoding:
Text File  |  1995-04-30  |  22.3 KB  |  607 lines  |  [TEXT/MMCC]

  1. /*
  2.  * lib.h - library definitions
  3.  *
  4.  * Author:  Eric Haines, 3D/Eye, Inc.
  5.  *
  6.  * Modified: 1 October 1992
  7.  *           Alexander R. Enzmann
  8.  *           I made quite a few changes in order to support multiple raytracers,
  9.  *           with the hopes that this library would become even more useful than
  10.  *           it already is.
  11.  *
  12.  * Modified: 17 Jan 1993
  13.  *           Eduard [esp] Schwan
  14.  *           Removed unused local variables & returned value in lib_output_color
  15.  *
  16.  * Modified: 17 Mar 1993
  17.  *           Eduard [esp] Schwan
  18.  *           Changed POV-Ray refs to OUTPUT_POVRAY_10 & OUTPUT_POVRAY_20
  19.  *           Changed POV-Ray 1.5 refs to 2.0
  20.  *           Passed bg_color to display routines
  21.  *             (unfortunate side-effect is you should now call
  22.  *             lib_output_background_color BEFORE lib_output_viewpoint.
  23.  *             This may not be the best approach - please review!)
  24.  *           Added OUTPUT_RAWTRI output, for creating Raw output for Raw2POV.
  25.  *           Added separator comment lines between fns for readability
  26.  *
  27.  * Modified: 30 Mar 1993
  28.  *           Eduard [esp] Schwan
  29.  *           Made poly static arrays dynamic
  30.  *           Created lib_init/lib_shutdown routines
  31.  *           Removed unused local variables
  32.  *           Added creation of enclosing sphere of bg color for POV-Ray
  33.  *
  34.  * Modified: 12 April 1993
  35.  *           Alexander R. Enzmann
  36.  *           Updated to include Eric Haines' version 3.1 SPD data types
  37.  *
  38.  * Modified: 16 April 1993
  39.  *           Eduard [esp] Schwan
  40.  *           Sprinkled MULTITASK macros in loops to let cooperative
  41.  *           multitasking OS systems (Macs) breathe, and added a
  42.  *           string version # & accessor routine for reporting.
  43.  *
  44.  * Modified: 27 July 1993
  45.  *           David Hook
  46.  *           Added converter for "art" ray tracer.
  47.  *
  48.  * Modified: 5 August 1993
  49.  *           Eduard [esp] Schwan
  50.  *           Fixed filename bug in lib_get_opts,
  51.  *           cleaned up Mac #pragma statements, made USAGE a fn,
  52.  *           added '/' as command line switch prefix for MSDOS dudes.
  53.  *           Added POV 2.0 cone and disc primitive syntax, removed
  54.  *           redundant "object { }" wrapper around POV 2.0 objects,
  55.  *           added POV 2.0 "background {}" statement.  Also cleaned
  56.  *           up indenting by adding tab_() routines.  Added A Enzmann's
  57.  *           fixes to the POV 1.0 cylinder/cone routines.
  58.  *
  59.  * Modified: 31 August 1993
  60.  *           Eric Haines
  61.  *           Minor syntax things (hey, I like 4 space indents).
  62.  *
  63.  * Modified: 5 September 1993
  64.  *           Antonio Costa
  65.  *           Changed EPSILON to EPSILON2 in several places
  66.  *           Removed incorrect statement in lib_output_polygon_cylcone()
  67.  *           Added missing break statement to RTrace related code (in
  68.  *           old line 757)
  69.  *
  70.  * Modified: 6 September 1993
  71.  *           Eric Haines
  72.  *           Created standardized lib_open/lib_close functions
  73.  *           Renamed lib_initialize/lib_shutdown to lib_storage_*
  74.  *
  75.  * Modified: 8 September 1993
  76.  *           Antonio Costa
  77.  *           Added global gRT_orig_format to make lib_open/lib_close work!
  78.  *
  79.  * Modified: 16 October 1993
  80.  *           Eduard [esp] Schwan
  81.  *           Added  show_usage prototype so shells.c can call it, broke lib.c
  82.  *           into several smaller sub-libraries for small-model compiles.
  83.  *
  84.  * Modified  19 January 1994
  85.  *           Philipp Slusallek
  86.  *           Added RIB file output
  87.  *
  88.  * Modified: 3 May 1994
  89.  *           Eric Haines
  90.  *           Split lib_get_opts to lib_gen_get_opts and lib_read_get_opts,
  91.  *           since the read*.c programs are functionally different than the
  92.  *           database generators.  Also split show_usage.
  93.  *
  94.  * Modified: 6 May 1994
  95.  *           Eduard [esp] Schwan
  96.  *           Broke libprm.c into even smaller sub-libraries for small-model
  97.  *           Mac compiles, since the new RIB code pushed us over again.
  98.  *           So libprm.c is now libpr1.c and libpr2.c.  Also took a guess and
  99.  *           added OUTPUT_RIB to the list in lib_output_comment() in libpr1.c.
  100.  *
  101.  * Modified: 13 May 1994
  102.  *           Eric Haines
  103.  *           Various changes from esp added, and put in primitive DXF output.
  104.  *           Named version 3.3 now to differentiate from DXF-less output
  105.  *           version Eduard is distributing.
  106.  *
  107.  * Modified: 15 November 1994
  108.  *           Alexander R. Enzmann
  109.  *           Added code for Wavefront OBJ files and RenderWare RWX files.
  110.  *           Adding code for transformation stacks, file jacks.c demonstrates
  111.  *           how they work.  Fixed PLG output.  Fixed ART output of tori
  112.  *           and added ART output of discs.  Modified Polyray and POV-Ray
  113.  *           viewpoints to give right handed coordinates.  Added the
  114.  *           file readobj.c to read WaveFront polygon files.  Added routines
  115.  *           to invert matrices, transform normals, and determine
  116.  *           rotate/scale/translate from a transform matrix. Modified
  117.  *           computation of perspective view matrix to be a little cleaner.
  118.  *
  119.  */
  120.  
  121.  
  122. #ifndef LIB_H
  123. #define LIB_H
  124.  
  125. #include "def.h"
  126. #include "libvec.h"
  127.  
  128. #if __cplusplus
  129. extern "C" {
  130. #endif
  131.  
  132. /* The version of this Library, see lib_get_version_str() */
  133. #define LIB_VERSION     "3.6"
  134.  
  135. /* Raytracers supported by this package (default OUTPUT_POVRAY): */
  136.  
  137. /* Note: any new renderers should be added between OUTPUT_VIDEO and
  138.    OUTPUT_DELAYED.  These two values are used as a range check that a known
  139.    renderer has been selected in "lib_set_raytracer" */
  140. #define OUTPUT_VIDEO      0 /* Output direct to the screen (sys dependent) */
  141. #define OUTPUT_NFF        1 /* MTV                                         */
  142. #define OUTPUT_POVRAY_10  2 /* POV-Ray 1.0                                 */
  143. #define OUTPUT_POLYRAY    3 /* Polyray v1.4 -> v1.8                        */
  144. #define OUTPUT_VIVID      4 /* Vivid 2.0                                   */
  145. #define OUTPUT_QRT        5 /* QRT 1.5                                     */
  146. #define OUTPUT_RAYSHADE   6 /* Rayshade                                    */
  147. #define OUTPUT_POVRAY_20  7 /* POV-Ray 2.x   */
  148. #define OUTPUT_RTRACE     8 /* RTrace 8.0.0                                */
  149. #define OUTPUT_PLG        9 /* PLG format for use with REND386/Avril       */
  150. #define OUTPUT_RAWTRI    10 /* Raw triangle output                         */
  151. #define OUTPUT_ART       11 /* Art 2.3                                     */
  152. #define OUTPUT_RIB       12 /* RenderMan RIB format                        */
  153. #define OUTPUT_DXF       13 /* Autodesk DXF format                         */
  154. #define OUTPUT_OBJ       14 /* Wavefront OBJ format                        */
  155. #define OUTPUT_RWX       15 /* RenderWare RWX script file                  */
  156. #define OUTPUT_DELAYED   16 /* Needed for RTRACE/PLG output.
  157.                    When this is used, all definitions will be
  158.                    stored rather than immediately dumped.  When
  159.                    all definitions are complete, use the call
  160.                    "lib_flush_definitions" to spit them all out. */
  161.  
  162. /* Default setting of output RT type - change to your favorite & recompile */
  163. #define OUTPUT_RT_DEFAULT   OUTPUT_NFF
  164.  
  165. /* Sets raw triangle output format to include texture name */
  166. #define RAWTRI_WITH_TEXTURES    0       /* set to 1 to include texture */
  167.  
  168. #define OUTPUT_RESOLUTION       4       /* default amount of polygonalization */
  169.  
  170.  
  171. /* ========== don't mess from here on down ============================= */
  172.  
  173. /* Output library definitions */
  174. #define OUTPUT_CURVES           0       /* true curve output */
  175. #define OUTPUT_PATCHES          1       /* polygonal patches output */
  176.  
  177. /* polygon stuff for libply.c and lib.c */
  178. #define VBUFFER_SIZE    1024
  179. #define POLYEND_SIZE    512
  180.  
  181. /*-----------------------------------------------------------------*/
  182. /* The following type definitions are used to build & store the database
  183.    internally.  For some renderers, you need to build the data file according
  184.    to a particular scheme (notably RTrace).  These data types are used to
  185.    hold the objects, lights, etc. until it is time to build the file.  */
  186.  
  187. /* Type definition for holding a light */
  188. typedef struct light_struct *light_ptr;
  189. struct light_struct {
  190.    COORD4 center_pt;
  191.    light_ptr next;
  192.    };
  193.  
  194. /* Type definition for holding a surface declaration */
  195. typedef struct surface_struct *surface_ptr;
  196. struct surface_struct {
  197.    char *surf_name;
  198.    unsigned int surf_index;
  199.    COORD3 color;
  200.    double ka, kd, ks, shine, ang, kt, ior;
  201.    surface_ptr next;
  202.    };
  203.  
  204. /* Diagonally opposite corners of a box */
  205. struct box_struct {
  206.    COORD3 point1, point2;
  207.    };
  208.  
  209. /* Base point/radius and Apex point/radius */
  210. struct cone_struct {
  211.    COORD4 apex_pt, base_pt;
  212.    };
  213.  
  214. /* Center, normal, inner, and outer radii of a annulus */
  215. struct disc_struct {
  216.    COORD3 center, normal;
  217.    double iradius, oradius;
  218.    };
  219.  
  220. /* 2D gridded data for a height field.  Limited support for this thing... */
  221. struct height_struct {
  222.    char *filename;
  223.    float **data;
  224.    unsigned int width, height;
  225.    float x0, x1, y0, y1, z0, z1;
  226.    };
  227.  
  228. /* Polygon - # of vertices and the 3D coordinates of the vertices themselves */
  229. struct polygon_struct {
  230.    unsigned int tot_vert;
  231.    COORD3 *vert;
  232.    };
  233.  
  234. /* Smooth patch.  Vertices and normals associated with them. */
  235. struct polypatch_struct {
  236.    unsigned int tot_vert;
  237.    COORD3 *vert, *norm;
  238.    };
  239.  
  240. /* Center/radius of a sphere */
  241. struct sphere_struct {
  242.    COORD4 center_pt;
  243.    };
  244.  
  245. /* Center, axis lengths, and exponents of a superquadric */
  246. struct superq_struct {
  247.    COORD3 center_pt;
  248.    double a1, a2, a3, n, e;
  249.    };
  250.  
  251. /* Center, direction of axis of symmetry, inner, and outer radii of a torus */
  252. struct torus_struct {
  253.    COORD3 center, normal;
  254.    double iradius, oradius;
  255.    };
  256.  
  257. /* Standard viewpoint stuff */
  258. typedef struct {
  259.    COORD3 from, at, up;
  260.    double angle, aspect, hither, dist;
  261.    int resx, resy;
  262.    MATRIX tx;
  263.    } viewpoint;
  264.  
  265. /*-----------------------------------------------------------------*/
  266. #define BOX_OBJ       1
  267. #define CONE_OBJ      2
  268. #define DISC_OBJ      3
  269. #define HEIGHT_OBJ    4
  270. #define POLYGON_OBJ   5
  271. #define POLYPATCH_OBJ 6
  272. #define SPHERE_OBJ    7
  273. #define SUPERQ_OBJ    8
  274. #define TORUS_OBJ     9
  275.  
  276. /* Union of all the object types */
  277. typedef struct object_struct *object_ptr;
  278. struct object_struct {
  279.    unsigned int object_type;  /* Identify what kind of object */
  280.    unsigned int curve_format; /* Output as surface or as polygons? */
  281.    unsigned int surf_index;   /* Which surface was associated with this object? */
  282.    MATRIX *tx;                /* Was there a matrix associated with this object? */
  283.    union {
  284.       struct box_struct       box;
  285.       struct cone_struct      cone;
  286.       struct disc_struct      disc;
  287.       struct height_struct    height;
  288.       struct polygon_struct   polygon;
  289.       struct polypatch_struct polypatch;
  290.       struct sphere_struct    sphere;
  291.       struct superq_struct    superq;
  292.       struct torus_struct     torus;
  293.       } object_data;
  294.    object_ptr next_object;
  295.    };
  296.  
  297. /*-----------------------------------------------------------------*/
  298. /* Global variables - lib.h                                        */
  299. /*-----------------------------------------------------------------*/
  300.  
  301. #ifdef OUTPUT_TO_FILE
  302. extern FILE * gStdout_file;
  303. #else
  304. #define gStdout_file stdout
  305. #endif /* OUTPUT_TO_FILE */
  306.  
  307. /*
  308. Here are some local variables that are used to control things like
  309. the current output file, current texture, ...
  310. */
  311. extern FILE *gOutfile;
  312. extern char *gTexture_name;
  313. extern int  gTexture_count;
  314. extern double gTexture_ior;
  315. extern int gObject_count;
  316. extern int  gRT_out_format;
  317. extern int  gRT_orig_format;
  318. extern int  gU_resolution;
  319. extern int  gV_resolution;
  320. extern COORD3 gBkgnd_color;
  321. extern COORD3 gFgnd_color;
  322. extern double gView_bounds[2][3];
  323. extern int gView_init_flag;
  324. extern char *gLib_version_str;
  325.  
  326. extern surface_ptr gLib_surfaces;
  327. extern object_ptr gLib_objects;
  328. extern light_ptr gLib_lights;
  329. extern viewpoint gViewpoint;
  330.  
  331. /* Globals for tracking indentation level of output file */
  332. extern int      gTab_width;
  333. extern int      gTab_level;
  334.  
  335. /*-----------------------------------------------------------------*/
  336. /* Global variables - libply.h                                     */
  337. /*-----------------------------------------------------------------*/
  338. /* Polygon stack for making PLG files */
  339. extern object_ptr gPolygon_stack;
  340. extern unsigned long gVertex_count; /* Vertex coordinates */
  341. extern unsigned long gNormal_count; /* Vertex normals */
  342.  
  343. /* Storage for polygon indices */
  344. extern unsigned int *gPoly_vbuffer;
  345. extern int *gPoly_end;
  346.  
  347. /* Globals to determine which axes can be used to split the polygon */
  348. extern int gPoly_Axis1;
  349. extern int gPoly_Axis2;
  350.  
  351.  
  352. /*-----------------------------------------------------------------*/
  353. /* Prototypes from libinf.c                                        */
  354. /*-----------------------------------------------------------------*/
  355.  
  356. void    tab_indent PARAMS((void));
  357. void    tab_inc PARAMS((void));
  358. void    tab_dec PARAMS((void));
  359. char *  lib_get_version_str PARAMS((void));
  360. void    lib_set_output_file PARAMS((FILE *new_outfile));
  361. void    lib_set_default_texture PARAMS((char *default_texture));
  362. void    lib_set_raytracer PARAMS((int default_tracer));
  363. void    lib_set_polygonalization PARAMS((int u_steps, int v_steps));
  364. void    lookup_surface_stats PARAMS((int index, int *tcount, double *tior));
  365.  
  366.  
  367. /*-----------------------------------------------------------------*/
  368. /* Prototypes from libpr1.c                                        */
  369. /*-----------------------------------------------------------------*/
  370.  
  371. void    lib_output_comment PARAMS((char *comment));
  372. void    lib_output_vector PARAMS((double x, double y, double z));
  373. void    axis_to_z PARAMS((COORD3 axis, double *xang, double *yang));
  374.  
  375. /*
  376.  * Output viewpoint location.  The parameters are:
  377.  *   From:   The eye location.
  378.  *   At:     A position to be at the center of the image.  A.k.a. "lookat"
  379.  *   Up:     A vector defining which direction is up.
  380.  *   Fov:    Vertical field of view of the camera
  381.  *   Aspect: Aspect ratio of horizontal fov to vertical fov
  382.  *   Hither: Minimum distance to any ray-surface intersection
  383.  *   Resx:   X resolution of resulting image
  384.  *   Resy:   Y resolution of resulting image
  385.  *
  386.  * For all databases some viewing parameters are always the same:
  387.  *
  388.  *   Viewing angle is defined as from the center of top pixel row to bottom
  389.  *     pixel row and left column to right column.
  390.  *   Yon is "at infinity."
  391.  */
  392. void    lib_output_viewpoint PARAMS((COORD3 from, COORD3 at, COORD3 up,
  393.                           double fov_angle, double aspect_ratio,
  394.                           double hither, int resx, int resy));
  395.  
  396.  
  397. /*
  398.  * Output light.  A light is defined by position.  All lights have the same
  399.  * intensity.
  400.  *
  401.  */
  402. void    lib_output_light PARAMS((COORD4 center_pt));
  403.  
  404.  
  405. /*-----------------------------------------------------------------*/
  406. /*
  407.  * Output background color.  A color is simply RGB (monitor dependent, but
  408.  * that's life).
  409.  * NOTE: Do this BEFORE lib_output_viewpoint(), for display_init()
  410.  */
  411. void    lib_output_background_color PARAMS((COORD3 color));
  412.  
  413.  
  414. /*-----------------------------------------------------------------*/
  415. /*
  416.  * Output color and shading parameters for all following objects
  417.  *
  418.  * For POV-Ray and Polyray, a character string will be returned that
  419.  * identified this texture.  The default texture will be updated with
  420.  * the name generated by this function.
  421.  *
  422.  * Meaning of the color and shading parameters:
  423.  *    name   = name that this surface can be referenced by...
  424.  *    color  = surface color
  425.  *    ka     = ambient component
  426.  *    kd     = diffuse component
  427.  *    ks     = amount contributed from the reflected direction
  428.  *    shine  = contribution from specular highlights
  429.  *    ang    = angle at which the specular highlight falls to 50% of maximum
  430.  *    t      = amount from the refracted direction
  431.  *    i_of_r = index of refraction of the surface
  432.  *
  433.  */
  434. char * lib_output_color PARAMS((char *name, COORD3 color, double ka,
  435.                    double kd, double ks, double shine,
  436.                    double ang, double kt, double i_of_r));
  437.  
  438.  
  439.  
  440. /*-----------------------------------------------------------------*/
  441. /* Prototypes from libpr2.c                                        */
  442. /*-----------------------------------------------------------------*/
  443.  
  444. /*-----------------------------------------------------------------*/
  445. /*
  446.  * Output cylinder or cone.  A cylinder is defined as having a radius and an
  447.  * axis defined by two points, which also define the top and bottom edge of the
  448.  * cylinder.  A cone is defined similarly, the difference being that the apex
  449.  * and base radii are different.  The apex radius is defined as being smaller
  450.  * than the base radius.  Note that the surface exists without endcaps.
  451.  *
  452.  * If format=OUTPUT_CURVES, output the cylinder/cone in format:
  453.  *     "c"
  454.  *     base.x base.y base.z base_radius
  455.  *     apex.x apex.y apex.z apex_radius
  456.  *
  457.  * If the format=OUTPUT_POLYGONS, the surface is polygonalized and output.
  458.  * (4*OUTPUT_RESOLUTION) polygons are output as rectangles by
  459.  * lib_output_polypatch.
  460.  */
  461. void lib_output_cylcone PARAMS((COORD4 base_pt, COORD4 apex_pt,
  462.                 int curve_format));
  463.  
  464.  
  465. /*-----------------------------------------------------------------*/
  466. void lib_output_disc PARAMS((COORD3 center, COORD3 normal,
  467.                  double iradius, double oradius,
  468.                  int curve_format));
  469.  
  470.  
  471. /*-----------------------------------------------------------------*/
  472. /*
  473.  * Output sphere.  A sphere is defined by a radius and center position.
  474.  *
  475.  * If format=OUTPUT_CURVES, output the sphere in format:
  476.  *     "s" center.x center.y center.z radius
  477.  *
  478.  * If the format=OUTPUT_POLYGONS, the sphere is polygonalized and output.
  479.  * The sphere is polygonalized by splitting it into 6 faces (of a cube
  480.  * projected onto the sphere) and dividing these faces by equally spaced
  481.  * great circles.  OUTPUT_RESOLUTION affects the number of great circles.
  482.  * (6*2*u_resolution*v_resolution) polygons are output as triangles
  483.  * using lib_output_polypatch.
  484.  */
  485. void lib_output_sphere PARAMS((COORD4 center_pt, int curve_format));
  486.  
  487.  
  488.  
  489. /*-----------------------------------------------------------------*/
  490. /* Output box.  A box is defined by a diagonally opposite corners. */
  491. void lib_output_box PARAMS((COORD3 point1, COORD3 point2));
  492.  
  493.  
  494. /*-----------------------------------------------------------------*/
  495. void lib_output_sq_sphere PARAMS((COORD4 center_pt, double a1, double a2,
  496.                   double a3, double n, double e));
  497.  
  498.  
  499. /*-----------------------------------------------------------------*/
  500. /* Prototypes from libpr3.c                                        */
  501. /*-----------------------------------------------------------------*/
  502.  
  503. /*-----------------------------------------------------------------*/
  504. void lib_output_height PARAMS((char *, float **, int, int,
  505.                    double, double, double, double, double, double));
  506.  
  507.  
  508. /*-----------------------------------------------------------------*/
  509. void lib_output_torus PARAMS((COORD3 center, COORD3 normal,
  510.                   double iradius, double oradius,
  511.                   int curve_format));
  512.  
  513.  
  514. /*-----------------------------------------------------------------*/
  515. /* Prototypes from libini.c                                        */
  516. /*-----------------------------------------------------------------*/
  517.  
  518. int     lib_open PARAMS((int raytracer_format, char *filename));
  519.  
  520. void    lib_close PARAMS((void));
  521.  
  522. void    lib_storage_initialize PARAMS((void));
  523.  
  524. void    lib_storage_shutdown PARAMS((void));
  525.  
  526. void    show_gen_usage PARAMS((void));
  527. void    show_read_usage PARAMS((void));
  528.  
  529. int     lib_gen_get_opts PARAMS((int argc, char *argv[],
  530.                  int *p_size, int *p_rdr, int *p_curve));
  531. int     lib_read_get_opts PARAMS((int argc, char *argv[],
  532.                   int *p_rdr, int *p_curve, char *p_infname));
  533.  
  534. void    lib_clear_database PARAMS((void));
  535. void    lib_flush_definitions PARAMS((void));
  536.  
  537.  
  538. /*-----------------------------------------------------------------*/
  539. /* Prototypes from libply.c                                        */
  540. /*-----------------------------------------------------------------*/
  541.  
  542. void    lib_output_polygon_cylcone PARAMS((COORD4 base_pt, COORD4 apex_pt));
  543. void    lib_output_polygon_disc PARAMS((COORD3 center, COORD3 normal,
  544.                                         double iradius, double oradius));
  545. void    lib_output_polygon_sphere PARAMS((COORD4 center_pt));
  546. void    lib_output_polygon_height PARAMS((int height, int width, float **data,
  547.                                         double x0, double x1,
  548.                                         double y0, double y1,
  549.                                         double z0, double z1));
  550. void    lib_output_polygon_torus PARAMS((COORD3 center, COORD3 normal,
  551.                                         double iradius, double oradius));
  552. void    lib_output_polygon_box PARAMS((COORD3 p1, COORD3 p2));
  553. void    lib_output_polygon PARAMS((int tot_vert, COORD3 vert[]));
  554. void    lib_output_polypatch PARAMS((int tot_vert, COORD3 vert[], COORD3 norm[]));
  555.  
  556.  
  557. /*-----------------------------------------------------------------*/
  558. /* Prototypes from libdmp.c                                        */
  559. /*-----------------------------------------------------------------*/
  560.  
  561. void    dump_plg_file PARAMS((void));
  562. void    dump_obj_file PARAMS((void));
  563. void    dump_all_objects PARAMS((void));
  564. void    dump_reorder_surfaces PARAMS((void));
  565. void    dump_all_lights PARAMS((void));
  566. void    dump_all_surfaces PARAMS((void));
  567.  
  568. /*-----------------------------------------------------------------*/
  569. /* Prototypes from libtx.c                                         */
  570. /*-----------------------------------------------------------------*/
  571. #define U_SCALEX   0
  572. #define U_SCALEY   1
  573. #define U_SCALEZ   2
  574. #define U_SHEARXY  3
  575. #define U_SHEARXZ  4
  576. #define U_SHEARYZ  5
  577. #define U_ROTATEX  6
  578. #define U_ROTATEY  7
  579. #define U_ROTATEZ  8
  580. #define U_TRANSX   9
  581. #define U_TRANSY  10
  582. #define U_TRANSZ  11
  583. #define U_PERSPX  12
  584. #define U_PERSPY  13
  585. #define U_PERSPZ  14
  586. #define U_PERSPW  15
  587.  
  588. int   lib_tx_active PARAMS((void));             /* Is a transform active? */
  589. void  lib_get_current_tx PARAMS((MATRIX));      /* Get the current transform */
  590. void  lib_set_current_tx PARAMS((MATRIX));      /* Replace the current transform */
  591. void  lib_output_tx_sequence PARAMS((void));    /* Write transform */
  592. void  lib_tx_pop PARAMS((void));                /* Pop off the top transform */
  593. void  lib_tx_push PARAMS((void));               /* Push the current transform */
  594. void  lib_tx_rotate PARAMS((int, double));      /* Rotate about a single axis (radians) */
  595. void  lib_tx_scale PARAMS((COORD3));            /* Scale on each axis */
  596. void  lib_tx_translate PARAMS((COORD3));        /* Add a translation */
  597. int   lib_tx_unwind PARAMS((MATRIX, double *)); /* Turn tx into rotate/scale/translate */
  598.  
  599. extern MATRIX IdentityTx; /* Identity matrix.  Don't write into this! */
  600.  
  601. #if __cplusplus
  602. }
  603. #endif
  604.  
  605. #endif /* LIB_H */
  606.  
  607.